import request from '@/utils/request'

export const listSetmeal = (search) => 
    request({
        url: '/setmeal',
        method: 'get',
        params: {
            pageNum: search.pageNum,
            pageSize:search.pageSize,
            queryString:search.queryString
        }
    }) 

export const removeSetmeal = (id) => 
        request({
        url: '/setmeal/' + id,
        method: 'delete'
    })

export const upda = (data) => 
    request({
        url: '/upload',
        method: 'post',
        data: data,
        headers: {
          'Content-Type': 'multipart/form-data'
        }
    })

export const updateSetmeal = (id, setmeal) =>
    request({
        url: '/setmeal/' + id,
        method: 'put',
        data: setmeal
    })

export const saveSetmeal = (setmeal) => 
    request({
        url: '/setmeal',
        method: 'post',
        data: setmeal        
    })

export const listAllSetmeal = () =>
    request({
        url: '/setmeal/all',
        method: 'get'
    })

export const getSetmealById = (id) =>
    request({
        url: '/setmeal/' + id,
        method: 'get'
    })